<template>
	<view class="wrap">
		<u-card :border="false" :head-border-bottom="false" :head-style="headStyle"  v-for="(item,index) in list" @click="maintenance_information(item.id)">
			<view class="store" slot="body">
				<view class="image">
					<image src="/static/images/car.png" mode="widthFix"></image>
				</view>
				<view class="content">
					<view class="title">
						<text style="margin-right: 10rpx;">{{item.car_num}}</text>
						<!-- <text>12345678</text> -->
					</view>
					<view class="address">
						<text style="margin-right: 10rpx;">{{item.brand}}</text>
						<text>{{item.model}}</text>
					</view>
				</view>
			
	<!-- 			<view class="select">
					默认
				</view> -->
			</view>
		</u-card>

		<!-- <view class="submit_btn">
			<u-button shape="circle" type="error" class="btn">添加车辆</u-button>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				headStyle:{
					padding:0
				},
				list:{}
			}
		},
		onShow() {
			this.getCarList();
		},
		methods: {
			getCarList() {
				this.$u.api.getCarList({}).then(res => {
					console.log(res);
					this.list = res.data;
				})
			},
			maintenance_information(id){
				console.log('123');
				uni.navigateTo({
					url: '/pages/maintenance_information/maintenance_information?id='+id
				});
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #f1f1f1;
	}
	.store{
		display: flex;
		justify-content: space-around;
		align-items: center;
		.image{
			
			width: 50rpx;
			height: 50rpx;
			image{
				width: 100%;
				height: 100%;
			}
		}
		.content{
			width: 70%;
			color: #333333;
			.title{
				font-size: 32rpx;
				font-weight: 700;
				
			}
		}
		
		.select{
			color: #eb3626;
			margin-top: -56rpx;
			margin-left: 20rpx;
		}
	
		
	}
	.submit_btn{
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		padding: 20rpx 18rpx;
		background: #fff;
		.btn button{
			background: #eb3626;
		}
	}

</style>
